//
//  NTOrderVC.swift
//  NTOrderModule
//
//  Created by zto_yhd on 2020/1/20.
//

import UIKit
import SnapKit

public class NTOrderVC: UIViewController {
    
    var listView: UITableView = {
        let tv = UITableView(frame: CGRect.zero, style: UITableView.Style.plain)
        tv.backgroundColor = UIColor.white
        tv.tableFooterView = UIView()
        return tv
    }()
    
    var dataArray: Array = ["跳转到订单详情", "跳转到订单详情", "跳转到订单详情", "跳转到订单详情", "跳转到订单详情"]

    override public func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        view.backgroundColor = UIColor.white
        self.title = "订单中心";
        
        listView.delegate = self
        listView.dataSource = self
        view.addSubview(listView)

        listView.snp.makeConstraints { make in
            make.edges.equalTo(view)
        }
        
    }

}

extension NTOrderVC: UITableViewDelegate, UITableViewDataSource {
    public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return dataArray.count
    }

    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = UITableViewCell(style: .default, reuseIdentifier: "UITableViewCellID")
        cell.textLabel?.text = dataArray[indexPath.row]
        return cell
    }

    public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
        
        let detailVC = NTOrderDetailVC()
        self.navigationController?.pushViewController(detailVC, animated: true)
        
    }
    
    
}


